<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title></title>
    <link rel="stylesheet" href="__STATIC__/css/mui.min.css"/>
    <link rel="stylesheet" href="__STATIC__/css/swiper.min.css">
    <link rel="stylesheet" href="__STATIC__/css/common.css">
    <link rel="stylesheet" href="__STATIC__/css/module.css">
    <script src="__STATIC__/js/jquery.min.js"></script>
    <script src="__STATIC__/js/mui.min.js"></script>
    <script src="__STATIC__/js/swiper.jquery.min.js"></script>
    <script src="__STATIC__/js/jquery.raty.min.js"></script>
    <!--上传插件-->
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/webuploader.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/diyUpload.css">
    <script type="text/javascript" src="__STATIC__/js/webuploader.html5only.min.js"></script>
    <script type="text/javascript" src="__STATIC__/js/diyUpload.js"></script>


</head>

<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-arrowleft mui-pull-left"></a>
    <h1 class="mui-title">评价晒单</h1>
</header>
<div class="mui-content">
    <div class="pingjia-con">
    
        <div class="head">
        {volist name="arr.goods" id="val"} 
            <a class="flex" href="#">
                <img src="__ROOT__/{$val.goods_pics}" alt="">
            
                <h2 class="flex-1">{$val.goods_name}</h2>
            </a>
            {/volist}
            <div class="mui-clearfix"></div>
        </div>
       
        <div class="pingfen-star">
            <div class="mui-pull-left">评分：</div>
            <div id="star" class="mui-pull-left"></div>
            <div class="mui-clearfix"></div>
        </div>
        <input type="hidden" id="orderid" name="orderid" value="{$order_id}">
        <input type="hidden" name="goods_idstr" value="{$arr.goods_idstr}">
        
        <textarea placeholder="评论数字不低于10个字~" id="miaoshu"></textarea>
        <!-- <div><img src="$filePath" alt=""></div> -->
        <div class="upload-wrap pad10">
            <div id="uploadImg"></div>
        </div>
    </div>
    <button class="mui-btn btn-tjpj diyStart" onclick="shangchuan();">提交</button>
</div>
<script>
    $(function(){
        $('#star').raty({
            score: 5,
            path: '__STATIC__/images/',
            size     : 24,
            starOff  : 'star-off-big.png',
            starOn   : 'star-on-big.png'
        });
        $('#uploadImg').diyUpload({
            url:'{:url("index/User/upload")}'
        });
    })
function shangchuan(){
	var miaoshu = $("#miaoshu").val();
	var score = $("input[name='score']").val();
	var orderid = $("input[name='orderid']").val();
	var goods_idstr = $("input[name='goods_idstr']").val();
	

	if (miaoshu=='') {
		alert("请填写评价");
		return false;
	}else{
		 url = "{:url('index/User/pingjia')}";
            $.post(url, {miaoshu:miaoshu,score:score,orderid:orderid,goods_idstr:goods_idstr}, function (data) {
                if (data >1) {
                	alert("评价成功");
                    //layer.msg("移除成功", {icon: 1, time: 1000});
                    location.href="{:url('index/User/order',array('type'=>0))}";
                } else {
                    alert("评价失败");
                }
            })
	}
	//location.href='{:url("index/User/index")}';
}
    
</script>
</body>
</html>